﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace AllenHung.FeedReader.Common
{
    public class BooleanToContentConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return (value is bool && (bool)value) ? "On" : "Off";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return !(value is string && ((string)value).Equals("On")) ? true : false;
        }
    }
}
